package cn.lijiguo.concurrency.part1.ch07;

/**
 * SynchronizedTest
 *
 * @author lijiguo
 * @date 2019/12/16 10:35
 */
public class SynchronizedTest {

    private static final Object LOCK = new Object();

    public static void main(String[] args) {
        Runnable runnable = () -> {
          synchronized (LOCK) {
              try {
                  Thread.sleep(10_000);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
          }
        };

        // 启动一个线程
        new Thread(runnable).start();
    }
}
